An replacement or alternative to Ohlife The fronted is here
After Ohlife ,the Chinese alternative juzishiguang also shutdown. After lots of searching, I found that those open source replacements are either limited in function or hard to deploy. So I came up with the idea using Flask to write an easy-to-deploy Ohlife replacement.
In a word, it's a email-based diary system.
The long version:
This program sends you an email everyday (or any time period you set) with greetings. All you have to do is reply this email and the reply content will be saved on the server. Pretty much the same as the original Ohlife.
Warning: The methods below can't be used right now.
Clone the repository and fill the config.yaml file according to comments and hit deploy.sh script.
Boom!
And enjoy using it.
Basically , you just need a Linux server with Python3 installed. Python2 is not supported.
The author have provided one-click install script in the project.But this script is not tested on many servers, if you want to deploy it manually or you encounter some wired problems. Please follow the steps below(The Steps are only tested on Ubuntu 14):
-
Install Postfix
Usesudo apt-get install postfix
to install postfix as the local SMTP server. During installation, you have to set your host name and server type. As for this project , you can choose 'Internet Server'. However,if you have some kind of SMTP service like SendGrid, you can pass this step. -
Clone the project
Usegit clone https://github.com/paulx3/ohlife_relacement_server.git
to clone the repository to your local server. -
Install Python 3 and its dependencies
Install Python3 usingsudo apt-get install -y python3-pip
. Enter the project foldercd ohlife_relacement_server
and install all python dependenciespip3 install -r requirements.txt
-
Register SendGrid
This project uses SendGrid or services alike to transform email into post request. So you should register one first. And by default, it uses SendGrid's SMTP API to send emails.
After you log in your SendGrid account, you can follow this guide to get your SMTP credential and set inconfig.cfg
file. And you can follow this tutorial to set inbound email parse.
The inbound email parse should send POST request tohttp://your.domain.name:port/save
. Say if you deploy the program on test.com:8090, then the target will behttp://test.com:8090/save
. -
Add Credential
You need to add several credentials before you deploy the server:
- Cloudmailin address
- Default admin username and password
- (optional) Amazon S3 credential
There is a template file called config.cfg in server folder. The content is pretty much obvious. You can just fill in your config and credentials.
This project has already provided two locale options. All you need to change is locale:en-US
in config.cfg
file. For example, if you want the Chinese version , you can change locale:en-US
in config.cfg
to locale:zh_Hans_CN
.
The project uses Python-Babel to achieve localization.The author
tries to tag all the text using Babel gettext()
I know the locale function for this app can be over-engineering.
So if you have a better option. You can open an issue or pull request. So if you are interested in localizing the project, please folow instruction below:
- Enter
locale
folder underserver
folder and copy the folderen-US
and give it a new name. - Using tools like Poedit to edit
ohlife.po
file and translate. The tool will automatically compile po file into mo binary file. - Edit
locale
inconfig.cfg
to the name of your new folder. For example, if you add a new folder calledspanish
. Then you have to uselocale:spanish
.
For detailed example of how to use Babel to do the localization , you can check this repository.
- Change to use Yaml as config
- Limit key API(Email Sending) access
- Json Export and import function
- Logging system
- Supporting email with photo attachment
- Third party SMTP service login support
- At least 80% code coverage
- Email sending function
- Deploy instruction
- Deploy script
- Front and end support for mobile app
- Mobile app
- Chinese Readme
- Localization
- Amazon S3 backup service
- A timer for backup and email sending task